---
sidebar_label: Hugging Face
---

import CodeBlock from "@theme/CodeBlock";
import ExampleHuggingFace from "@examples/huggingface-llm-example/huggingface_example.go";

# Hugging Face

## Overview

This documentation provides a detailed overview and technical guidance for integrating the Hugging Face machine learning models with the LangchainGo library in the Go programming environment. This integration allows Go developers to leverage the power of pre-trained AI models for various applications, including natural language processing, text generation, and more.

## Prerequisites
Go programming language installed on your machine (version 1.15 or higher recommended).
A valid Hugging Face API token. Obtain it by creating an account on the Hugging Face platform and generating a new token

## Installation

```bash
go get github.com/tmc/langchaingo
```
Ensure that your Hugging Face API token is set as an environment variable:

```bash
export HUGGINGFACEHUB_API_TOKEN='your_hugging_face_api_token'
```

## Usage

<CodeBlock language="go">{ExampleHuggingFace}</CodeBlock>
